home *** CD-ROM | disk | FTP | other *** search
/ Champak 49 / Volume 49 - JOGO DISK .iso / Games / honeytrouble.swf / scripts / DefineSprite_533 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  594 b   |  29 lines

  1. getNum = function(n, obj, num_mc, width)
  2. {
  3.    _root.score_n = n;
  4.    trace(_root.score_n);
  5.    var numStr;
  6.    numStr = String(n);
  7.    for(name in obj)
  8.    {
  9.       if(typeof obj[name] == "movieclip")
  10.       {
  11.          obj[name].removeMovieClip();
  12.       }
  13.    }
  14.    i = 0;
  15.    while(i < numStr.length)
  16.    {
  17.       t = Number(numStr.charAt(i));
  18.       obj.attachMovie(num_mc,num_mc + i,i + 5);
  19.       with(obj[num_mc + i])
  20.       {
  21.          _x = i * width;
  22.          gotoAndStop(t + 1);
  23.       }
  24.       i++;
  25.    }
  26. };
  27. trace("score2:" + _root.score);
  28. getNum(_root.score,obj,"mynum",12);
  29.